<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta http-equiv="Access-Control-Allow-Origin" content="*" />
    <meta http-equiv="Access-Control-Allow-Headers" content="X-Requested-With" />
    <meta http-equiv="Access-Control-Allow-Methods" content="PUT,POST,GET,DELETE,OPTIONS" />
    <title>报名</title>
    <script src="http://code.jquery.com/jquery-3.2.1.min.js"></script>

    <link rel="stylesheet" type="text/css" href="/static/layui/css/layui.css" media="all">
    <script type="text/javascript" src="/static/layui/layui.js"></script>

    <script src="/static/js/signin.js"async></script>
    <script src="/static/css/font_1554827_uixfzwgne2o/iconfont.js"></script>
    <link rel="stylesheet" type="text/css" href="/static/css/sign.css">
    <link rel="stylesheet" type="text/css" href="/static/css/bootstrap.min.css">

    <style>
        .icon {
            width: 1.8em;
            height: 1.8em;
            vertical-align: -0.15em;
            fill: currentColor;
            overflow: hidden;
        }
    </style>
</head>
<body>

<div class="limiter">
    <div class="container-login100">
        <div class="wrap-login100">
            <form class="login100-form validate-form">
					<span class="login100-form-title p-b-26">
						报名
					</span>

                <span class="login100-form-title p-b-48">
						<svg class="icon" aria-hidden="true">
							<use xlink:href="#icon-zhuce"></use>
						</svg>
					</span>

                <input type="hidden" name="act_sch_id" value="{$school.id}"/>

                <div class="wrap-input100 validate-input">
                    <input class="input100" type="text" name="realname">
                    <span class="focus-input100" data-placeholder="姓名"></span>
                </div>


                <div class="wrap-input100 validate-input">
                    <input class="input100" type="tel" name="mobile" >
                    <span class="focus-input100" data-placeholder="手机号"></span>
                </div>

            </form>

            <div class="container-login100-form-btn">
                <div class="wrap-login100-form-btn">
                    <div class="login100-form-bgbtn"></div>
                    <button class="login100-form-btn"  name='submit' onclick="save()">
                        开始答题
                    </button>
                </div>
            </div>

        </div>
    </div>
</div>

</body>
</html>
<script type="text/javascript">
    layui.use(['form'],function(){
        form = layui.form;
        $ = layui.jquery;
    });
    function save(){
        $.post('/api/apply',$('form').serialize(),function(res){
            if(res.code == 0){
                layer.msg(res.message,{'icon':1});
                //1s后跳转答题页面
                setTimeout(function(){
                    // 跳转到答题页面
                    // window.location.href = '/index/question'; //可以后退
                    window.location.replace('/{$school.school_abbr}/qt');  //不可以后退
                },1000);
            }else{
                layer.msg(res.message,{'icon':2});
            }
        },'json');
    }
</script>